CURRENT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
PACKAGE_VERSION=$(shell node -p "require('./package.json').version")
DOCKER_REPOSITORY=docker-hosted.nstl-dev.com/nstl/region

.PHONY: default
default: windows macos # This is make default, build image and push image to host repository.

.PHONY: tree
tree: # Print tree dir to 'tree.txt'.
	@tree -I ".git|.idea|tree.txt|.gitignore|go.mod|*.iml" -a --dirsfirst > tree.txt

.PHONY: help
help: # This help.
	@sed -rn 's/^([a-zA-Z_-]+):.*?#(.*)$$/"\1" "\2"/p' < $(MAKEFILE_LIST) | xargs printf "make %-20s# %s\n"

.PHONY: windows
windows: # 构建windows_64程序.
	CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/z3box_windows_amd64.exe main.go

.PHONY: macos
macos: # 构建macos程序.
	CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/z3box_darwin_amd64 main.go
